Skip to content

Add API Routes And templated Clients - #9

Merged
ahcodedev merged 2 commits into
mainfrom
add-routes
Nov 8, 2026
Merged

ahcodedev merged 2 commits into
mainfrom
add-routes

Conversation

@ahcodedev

@ahcodedev ahcodedev commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds the PriceCharting API routes and template sync and async clients.

Routes (route.py)

  • BASE_URL for https://www.pricecharting.com.
  • Prices enum: /api/product, /api/products.
  • MarketPlace enum: /api/offers plus the offer-publish, offer-details, offer-feedback, offer-ship, offer-end and offer-refund endpoints.
  • Route enum that groups Prices and MarketPlace.

Clients

  • PyPriceCharting (sync, httpx2.Client) and AsyncPyPriceCharting (async, httpx2.AsyncClient), both created with an API token.
  • Context manager support: with PyPriceCharting(token) as client: and async with AsyncPyPriceCharting(token) as client: close the HTTP client on exit, including when an error is raised.
  • Stub methods for every API operation: product, products, offers, offer_details, offer_publish, offer_feedback, offer_ship, offer_end, offer_refund. They return None for now.

Tests and tooling

  • Tests for the route enums, client setup and teardown, context manager behavior, and the stub methods. The stub tests only check that each method can be called, and should be updated as the methods get implemented.
  • Adds pytest-asyncio to the dev group and sets asyncio_mode = "auto" with function-scoped event loops.

Type of Change

Feature

Checklist

  • just lint passes
  • just test passes
  • Tests added or updated for the change
  • README.md updated if needed
  • Release label added

@ahcodedev ahcodedev added the feature New feature (minor version bump) label Nov 8, 2026
@ahcodedev
ahcodedev merged commit 3989702 into main Nov 8, 2026
9 checks passed
@ahcodedev
ahcodedev deleted the add-routes branch November 8, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature (minor version bump)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant